package com.ruoyi.web.controller.shopping.category;

import com.ruoyi.system.domain.Category;
import com.ruoyi.system.service.CategoryService;
import com.ruoyi.system.view.common.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/xiaomi/v2/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping
    public R<List<Category>> selectCategoryList(){
        List<Category> categories = categoryService.selectCategoryList();
        System.out.println(categories);
        return R.success(categories);
    }
}
